package gameEngine;

public class Turn {
	private int playerID;
	private TurnAction action;
	private int quantity;
	public Turn(int pid,TurnAction a, int q){
		playerID = pid;
		action = a;
		quantity = q;
	}
	public Turn(String socketRep){
		String[] split = socketRep.split(",");
		playerID = Integer.parseInt(split[0]);
		action = TurnAction.valueOf(split[1]);
		quantity = Integer.parseInt(split[2]);
	}
	public String toString(){
		return playerID+","+action+","+quantity;
	}
	@Override
	public boolean equals(Object other){
		return this.toString().equals(other.toString());
	}
}
